package com.bawei.yangzongcai___chenmei.BlankFragment.Blanck1;


import android.graphics.drawable.AnimationDrawable;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.bawei.yangzongcai___chenmei.MVC.BsaeFragment;
import com.bawei.yangzongcai___chenmei.R;


public class BlankFragmentZhu3 extends BsaeFragment {


    private ImageView zhu3Img;
    private Button zhu3Kaishi;
    private Button zhu3Jieshu;

    @Override
    public int bandLayout() {
        return R.layout.fragment_blank_fragment_zhu3;
    }

    @Override
    public void initView() {

        zhu3Img = findbandid(R.id.zhu3_img);
        zhu3Kaishi = findbandid(R.id.zhu3_kaishi);
        zhu3Jieshu = findbandid(R.id.zhu3_jieshu);
    }

    @Override
    public void initDate() {

        final AnimationDrawable drawable = new AnimationDrawable();
        drawable.addFrame(
                getResources().getDrawable(R.drawable.dong1), 50);
        drawable.addFrame(
                getResources().getDrawable(R.drawable.dong2), 50);
        drawable.addFrame(
                getResources().getDrawable(R.drawable.dong3), 50);
        drawable.addFrame(
                getResources().getDrawable(R.drawable.dong4), 50);
        drawable.addFrame(
                getResources().getDrawable(R.drawable.dong5), 50);
        drawable.addFrame(
                getResources().getDrawable(R.drawable.dong6), 50);
        drawable.addFrame(
                getResources().getDrawable(R.drawable.dong7), 50);
        drawable.addFrame(
                getResources().getDrawable(R.drawable.dong8), 50);
        drawable.addFrame(getResources().getDrawable(R.drawable.dong9), 50);
        drawable.setOneShot(false);
        zhu3Img.setImageDrawable(drawable);
        zhu3Kaishi.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                drawable.start();
            }
        });
        zhu3Jieshu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                drawable.stop();
            }
        });

    }
}
